<?php
/* ======================================== 
 *  conroller.php
 * --------------------
 * Created on 02.04.2010
 * ========================================
 * $Revision: $
 * $Author: $
 * $HeadURL: $
 * $Id: $
 * ========================================
 * Changes ["date: description (who)"]:
 *
 * 02.04.2010: Original version (WHo)
 * 15:26:10: Time
 */

require_once('app/Controller.php');
require_once("app/Page.php");
require_once('include/Utils.php');
require_once('modules/start/StartPage.php');

class StartController extends Controller {

	public $tabKey = 'start';
	/**
	 * construct
	 * @return void
	 */
	public function __construct(){
		parent::__construct();
		$settings = App::settings();
		//check existence needed key in settings
		if(!in_array($this->tabKey,$settings['module'])){
			$this->tabKey = null;
		}
	}

	public function action_execute(){
		$p = new Page();
		$p = new StartPage();
		if($this->tabKey!=null){
			$cont = $this->getContent();
			$p->setContent($cont);
		}
		$p->show();
	}

	private function getContent(){
		$settings = App::settings();
		$cont = file_get_contents($settings['templatePath'].'/start.tpl');
		return $cont;
	}

}
?>